package cn.xiaobai.tools;

/**
 * @Author yangdaji
 * @Date 2023/10/27
 * @PackageName cn.xiaobai.tools
 * @ClassName ClassConvertUtils
 */
public class ClassConvertUtils {

    public static String convertClassName(String name) {
        return convertClassName(name, null);
    }

    public static String convertClassName(String name, String prefix) {
        name = name.replace('/', '.');
        name = name.replace('\\', '.');
        name = name.substring(0, name.length() - ".class".length());
        if (prefix != null) {
            name = name.substring(prefix.length());
        }
        return name;
    }
}
